﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
namespace Ascent.QiPei.Module.BusinessObjects.Sales
{
  public partial class CustomerReturnItems : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private System.String _remark;
    private System.Single _wasteQuantify;
    private System.Single _returnPrice;
    private System.String _returnsCause;
    private System.Int32 _availableQuantity;
    private Ascent.QiPei.Module.BusinessObjects.Sales.CustomerReturn _customerReturn;
    private Ascent.QiPei.Module.BusinessObjects.Base.Product _product;
    public CustomerReturnItems(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("产品")]
    public Ascent.QiPei.Module.BusinessObjects.Base.Product Product
    {
      get
      {
        return _product;
      }
      set
      {
          SetPropertyValue("Product", ref _product, value);
        //if (_product == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.Product prevProduct = _product;
        //_product = value;
        //if (IsLoading)
        //  return;
        //if (prevProduct != null && prevProduct.CustomerReturnItems == this)
        //  prevProduct.CustomerReturnItems = null;
        //if (_product != null)
        //  _product.CustomerReturnItems = this;
        //OnChanged("Product");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("退货数量")]
    public System.Int32 AvailableQuantity
    {
      get
      {
        return _availableQuantity;
      }
      set
      {
        SetPropertyValue("AvailableQuantity", ref _availableQuantity, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("废品数量")]
    public System.Single WasteQuantify
    {
      get
      {
        return _wasteQuantify;
      }
      set
      {
        SetPropertyValue("WasteQuantify", ref _wasteQuantify, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("退货价格")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.Single ReturnPrice
    {
      get
      {
        return _returnPrice;
      }
      set
      {
        SetPropertyValue("ReturnPrice", ref _returnPrice, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("退货原因")]
    public System.String ReturnsCause
    {
      get
      {
        return _returnsCause;
      }
      set
      {
        SetPropertyValue("ReturnsCause", ref _returnsCause, value);
      }
    }
    [DevExpress.Xpo.AssociationAttribute("CustomerReturnItems-CustomerReturn")]
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Sales.CustomerReturn CustomerReturn
    {
      get
      {
        return _customerReturn;
      }
      set
      {
        SetPropertyValue("CustomerReturn", ref _customerReturn, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remark
    {
      get
      {
        return _remark;
      }
      set
      {
        SetPropertyValue("Remark", ref _remark, value);
      }
    }
  }
}
